<?php
require_once("Answer.php");

class Question
{
	public $Id;
	public $Content;
	public $Category;
	public $Sound;
	public $Paragraph;
	
	public function IsMultiChoice($listAnswers)
	{
		$count = 0;
		for($i = 0; $i < count($listAnswers); $i++)
		{
			if($listAnswers[$i]->IsCorrect == 1)
				$count++;
		}
		if($count > 1)
			return true;
		return false;
	}
	
	public function GetRightAnswers($listAnswers)
	{
		$str = "";
		for($i = 0; $i < count($listAnswers); $i++)
		{
			if($listAnswers[$i]->IsCorrect == 1)
				$str = $str . $listAnswers[$i]->Id . "_";
		}
		if($str != "")
			$str = substr($str, 0, strlen($str) - 1);
		return $str;
	}
}

?>